/* test_007
 * working w/ threads
 */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <pthread.h>

void *techo (void *ptr)
{
	sleep(5);
	printf("techo\t\t:%s\n", (char*) ptr);
}

int main(int argc, char **argv)
{
	pthread_t th1, th2;
	char *message1 = "Thread1's unique message";
	char *message2 = "Th2: check the damn spelling";
	int ret1, ret2;
	short wtf1, wtf2;

	ret1 = pthread_create(&th1, NULL, techo, (void*) message1);
	ret2 = pthread_create(&th2, NULL, techo, (void*) message2);

	pthread_join(th1,NULL);
	pthread_join(th2,NULL);

	printf("main\t\t: (ret1:%d),(ret2:%d),(wtf1:%d),(wtf2:%d) , (th1:%d),(th2:%d)\n",
		ret1, ret2, wtf1, wtf2, (int)th1, (int)th2);
	exit(0);
}
